Field of the Invention
The present invention generally relates to graphics processing and more specifically to a system and method for enabling calling functions and subroutines indirectly through function pointers in a single-instruction, multiple-thread (“SIMT”) architecture.
Description of the Related Art
Current graphics data processing includes systems and methods developed to perform specific operations on graphics data such as, for example, linear interpolation, tessellation, rasterization, texture mapping, depth testing, etc. Traditionally, graphics processors used fixed function computational units to process graphics data; however, more recently, portions of graphics processors have been made programmable, enabling such processors to support a wider variety of operations for processing vertex and fragment data.
To further increase performance, graphics processors typically implement processing techniques such as pipelining that attempt to process in parallel as much graphics data as possible throughout the different parts of the graphics pipeline. Graphics processors with SIMD (single-instruction multiple-data) architectures are designed to maximize the amount of parallel processing in the graphics pipeline. In a SIMD architecture, the same instruction is executed in parallel to process multiple data inputs. A single-instruction, multiple-thread (“SIMT”) architecture provides greater flexibility than a SIMD architecture since threads in a group of threads may follow different paths through a set of instructions to process multiple data inputs. A SIMD instruction specifies the execution and branching behavior of a single control thread controlling operations on a vector of multiple data inputs. In contrast, a SIMT instruction specifies the execution and branching behavior of one individual independent thread operating on its data inputs, and a SIMT architecture applies a SIMT instruction to multiple independent threads in parallel which are free to execute and branch independently. Conditional break and return instructions in which threads may branch independently are used for advanced control flow in order to improve processing efficiency. In particular, threads that execute a break or return may complete processing earlier than threads that do not execute the break or return. Threads that have diverged during the execution of conditional instructions are then synchronized so that those threads are executed in parallel. Current SIMT architectures do not provide an ability to call functions and subroutines indirectly through function pointers where each individual thread may have a different pointer value. Many programming languages such as C have indirect function calls, and others such as C++ have virtual functions, both of which require processors to provide the ability to call functions indirectly via a pointer. Indirect branches and indirect branch tables are used to improve processing performance compared with sequential chains of tests and branches.
Accordingly, what is needed in the art is a SIMT architecture that allows indirect function calls using function pointers.